﻿using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;

using SB.Logging;

namespace SB.MediaLibrary.Entities
{
    /// <summary>
    /// Film object for NHibernate mapped table Film.
    /// </summary>
    public class Film
    {
        #region Private Fields
        private static readonly ILogger log = LoggingFacade.GetLogger(typeof(Film));

        private Guid _GUID;
        private string _Name;
        private Genre _Genre;
        private Medium _Medium;
        #endregion //Private Fields

        #region Public Properties

        public virtual Guid GUID
        {
            get { return _GUID; }
            set { _GUID = value; }
        }

        public virtual string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }

        public virtual Genre Genre
        {
            get { return _Genre; }
            set { _Genre = value; }
        }

        public virtual Medium Medium
        {
            get { return _Medium; }
            set { _Medium = value; }
        }


        #endregion //Public Properties

        #region User Generated Code

        public override string ToString()
        {
            return Name;
        }

        #endregion // User Generated Code

        #region Equals and GetHashCode
        public override bool Equals(object obj)
        {
            if (obj is Film)
            {
                Film a = (Film)obj;
                if (a.GUID == GUID)
                    return true;
            }
            return false;
        }
        public override int GetHashCode()
        {
            return GUID.GetHashCode();
        }
        #endregion //Equals and GetHashCode

    }
}